package com.poc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.integration.annotation.Transformer;

@SpringBootApplication
@EnableBinding(Processor.class)
public class MessageAdaptorApp {
    private static final Logger LOGGER = LoggerFactory.getLogger(MessageAdaptorApp.class);

    @Transformer(inputChannel = Processor.INPUT, outputChannel = Processor.OUTPUT)
    public String sendMessage(String inputMsg) {
        LOGGER.info("input message: {}", inputMsg);
        return inputMsg;
    }

    public static void main(String[] args) {
        SpringApplication.run(MessageAdaptorApp.class, args);
    }
}
